<?php
include_once("codelibrary/inc/variables.php");
include_once("session.php");
include_once("codelibrary/inc/functions.php");

$business_id = $_SESSION['business_id'];
$type = $_REQUEST['type'];
$customer_id=$id;
$getData=getAnyTableWhereData($customer_info_table," and customer_id=$id");
$birthdate = $getData['birthdate'];
if(isset($_REQUEST['Submit']))
{
    $customer_id=$_REQUEST['customer_id'];
	$firstname=$_REQUEST['TRFN_FirstName'];
	$lastname=$_REQUEST['TRFN_LastName'];
	$address=$_REQUEST['TN_Address'];
	$city=$_REQUEST['TN_City'];
	$state=$_REQUEST['TN_State']; 
	$zipcode=$_REQUEST['TN_Zip'];
	$dayphone=$_REQUEST['PHN_DayPhone'];
	$eveningphone=$_REQUEST['PHN_EveningPhone'];
	$cellphone=$_REQUEST['PHN_CellPhone'];
	$email=$_REQUEST['TNEF_Email'];
	$username=$_REQUEST['TNLEN_UserName'];
	$password=$_REQUEST['TN_Password'];
	$leadtype=$_REQUEST['TN_LeadType'];
	$contactokay=$_REQUEST['TN_ContactOkay'];
	$callokay=$_REQUEST['TN_CallOkay'];
	$emailokay=$_REQUEST['TN_EmailOkay'];
	$mailokay=$_REQUEST['TN_MailOkay'];
	$paymentmethod=$_REQUEST['TN_PaymentMethod'];
	$ccn=$_REQUEST['TN_CCN'];
	$expiredmonth=$_REQUEST['TN_ExpMonth'];
	$expiredyear=$_REQUEST['TN_ExpYear'];
	$cardcode=$_REQUEST['TN_CardCode'];
	$cardname=$_REQUEST['TN_CardName'];
	$companyname=$_REQUEST['TN_Company'];
	$occupation=$_REQUEST['TN_Occupation'];
	
	$birthdate=$_REQUEST['BirthDate'];
	if($birthdate!="")
	{
	   $birthdate=$birthdate;
	}
	else
	{
	   $birthdate=date("Y-m-d");
	}
	
	$gender=$TN_Gender;
	$status=$TN_CustomerStatus;
	$loginallowed=$TN_LoginAllowed;
	$customertype=$TN_CustomerType;
	$staffassignedto=$TN_AssignedTo;
	$accountnumber=$TN_AccountNumber;
	$specialneeds=$TN_SpecialNeeds;
	$alert=$TN_Alert;  
	$refferedby=$TN_ReferredBy; 
	
	$update_sql="update $customer_info_table set firstname='$firstname' , lastname='$lastname' ,  address='$address' , city='$city' , state='$state' , zipcode='$zipcode' , dayphone='$dayphone' , eveningphone='$eveningphone' , cellphone='$cellphone' , email='$email' , username='$username', password='$password' , leadtype='$leadtype' , contactokay='$contactokay' , callokay='$callokay', emailokay='$emailokay', mailokay='$mailokay', paymentmethod='$paymentmethod', ccn='$ccn', expiredmonth='$expiredmonth', expiredyear='$expiredyear', cardcode='$cardcode', cardname='$cardname', companyname='$companyname', occupation='$occupation', birthdate='$birthdate', gender='$gender', status='$status', loginallowed='$loginallowed', customertype='$customertype', staffassignedto='$staffassignedto', accountnumber='$accountnumber', specialneeds='$specialneeds', alert='$alert', refferedby='$refferedby' where customer_id='$customer_id'";
	mysql_query($update_sql);
	if($type==1)
	{
	  header("Location: customer-view-details.php?msg=Edited");
	}
	else
	{
	  header("Location: detail-customer.php?msg=Edited");
	}
}
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="LTR" lang="en">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<title>Online Appointment</title>
<script type="text/javascript" src="codelibrary/js/common.Js"></script>
<script language="JavaScript1.2" src="codelibrary/js/cal_change.js"></script>
<script type="text/javascript" src="calendarDateInput.js"></script>
<script type="text/javascript">
function submitform()
{
    if(ValidateForm(document.frm))
	{
	    return true;
	}
	else
	{
	    return false;
	}
}
</script>

<base >
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<title>Staff Management</title>

</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">


<table cellpadding="0" cellspacing="0" border="0"><tr>
  <td style="background:url(images/top.gif) repeat-x top; ">
<table cellpadding="0" cellspacing="0" border="0" style="width:764px" align="center"> 
	<tr>
		<td>
			<table cellpadding="0" cellspacing="0" border="0" style="height:57">
				<tr>
					<td height="57">
<? html_header(); ?>					</td>
				</tr>
			</table>


		</td>
	</tr>
	<tr>
		<td>





<table border="0" width="105%" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top" class="col_left">

<table border="0"cellspacing="0" cellpadding="0" class="box_width_left">
	<tr><td width="100%">
		<table border="0" cellspacing="0" cellpadding="0">
<tr><td>

<table border="0" width="100%" cellspacing="0" cellpadding="0" class="">
  <tr>
    <td>
    <table border="0" width="100%" cellspacing="0" cellpadding="0"  class="" height="91">
  <tr>
    <td align="center" height="91">
    <img border="0" src="images/logo.jpg" width="208" height="86"></td>
  </tr>
</table>
</td>
  </tr>
</table>
</td></tr>


          <tr>
            <td>
<table border="0" width="100%" cellspacing="0" cellpadding="0"  class="box_header_txt" height="48">
  <tr>
    <td style="background-image: url(images/1_bg2-2.gif)" height="1">
      <p style="margin-top: 16"> </td>
  </tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="0"   style="border-bottom:12px solid #ffffff;">
  <tr>
    <td>
    <table border="0" width="100%" cellspacing="0" cellpadding="0"  style="margin-bottom:0px;background:#7C7C7C url(images/1_line.gif) no-repeat left bottom;" >
  <tr>
    <td  style="padding:3px 16px 8px 25px;">
      <table width="100%" border="0">
                                            <tr>
                                              <td><a href="edit-customer.php?customer_id=<?=$customer_id;?>" class="topmenulink"><strong>Personal Information</strong></a></td>
                                            </tr>
                                            <tr>
                                              <td><a href="add-customer-notes.php?customer_id=<?=$customer_id;?>" class="topmenulink"><strong>Customer Notes </strong></a></td>
                                            </tr>
											<tr>
                                              <td><a href="appointment-history-details.php?customer_id=<?=$customer_id;?>" class="topmenulink"><strong>Appointment History </strong></a></td>
                                            </tr>
											<tr>
                                              <td><a href="make-appointment.php?customer_id=<?=$customer_id;?>" class="topmenulink"><strong>Make Appointments </strong></a></td>
                                            </tr>
                                          </table>
    </td>
  </tr>
</table>
</td>
  </tr>
</table>
            </td>
          </tr>


          <tr>
            <td class="">&nbsp;
</td>
          </tr>

		</table>
	</td>
	<td><img src="images/spacer.gif" border="0" alt="" width="15" height="1"></td></tr>
</table>

    </td>

    <td width="100%" valign="top">
<table border="0" width="100%" cellspacing="0" cellpadding="0"  class="cont_header_txt">
  <tr>
    <td>
			<table border="0" cellpadding="0" cellspacing="0" bgcolor="#EAEAEA" class="cont_header_txt">
				<tr>
					<td><img src="images/1_q1.gif" border="0" alt="" width="45" height="39"></td>
					<td style="width:100%">Create Personnel Record</td>
					<td><img src="images/1_q2.gif" border="0" alt="" width="10" height="39"></td>
				</tr>
			</table>										 
			</td>
  </tr>
</table>


						
			<table cellpadding="0" cellspacing="0" border="0" style="border:0px solid #DEDEDE; border-width:0px 1px 0px 1px;">
			              <tr>
						    <td align="left" style="background:#ffffff;border:0px solid #ffffff; border-width:18px 5px 10px 5px;">
							<strong>Customer</strong>&nbsp;&nbsp;<?=$getData['firstname'];?>&nbsp;&nbsp;<?=$getData['lastname'];?>
							</td>
						  </tr>
                          <tr>
                            <td style="background:#ffffff;border:0px solid #ffffff; border-width:18px 5px 10px 5px;"><!-- new_products //-->
                                <table border="0" width="" cellspacing="0" cellpadding="0">
                                  <tr>
                                    <td><form name="frm" action="" method="post" onSubmit="return submitform();">
                                <table width="108%" border="1" cellpadding="3" cellspacing="2" bordercolor="#FFDBCA" class="table">
                                  <tr>
                                    <td width="34%" height="27" valign="bottom" class="simpletxt">&nbsp;First Name </td>
                                    <td width="66%" height="27" colspan="2" valign="bottom" class="simpletxt"><INPUT name="TRFN_FirstName"  type="TEXT" value="<?=$getData['firstname'];?>" size="30">
                                    </td>
                                  </tr>
                                  <tr>
                                    <td height="27" valign="bottom" class="simpletxt">&nbsp;Last Name </td>
                                    <td height="27" colspan="2" valign="bottom" class="simpletxt"><INPUT name="TRFN_LastName" type="TEXT" value="<?=$getData['lastname'];?>" size="30">
                                    </td>
                                  </tr>
                                 <tr>
                                    <td height="27" valign="bottom" class="simpletxt">&nbsp;Address </td>
                                    <td height="27" colspan="2" valign="bottom" class="simpletxt"><textarea name="TN_Address" rows="3" cols="3"><?=$getData['address'];?>
</textarea></td>
                                  </tr>
                                  <tr>
                                    <td height="27" valign="bottom" class="simpletxt">&nbsp;City </td>
                                    <td height="27" colspan="2" valign="bottom" class="simpletxt"><INPUT name="TN_City"  type="TEXT" value="<?=$getData['city'];?>" size="30"></td>
                                  </tr>
                                  <tr>
                                    <td height="27" valign="bottom" class="simpletxt">&nbsp;State </td>
                                    <td height="27" colspan="2" valign="bottom" class="simpletxt"><INPUT name="TN_State"  type="TEXT"  value="<?=$getData['state'];?>" size="30"></td>
                                  </tr>
                                  <tr>
                                    <td height="27" valign="bottom" class="simpletxt"><strong>&nbsp;</strong>Zip Code </td>
                                    <td height="27" colspan="2" valign="bottom" class="simpletxt"><INPUT name="TN_Zip"  type="TEXT" value="<? if($getData['zipcode']!=0){echo $getData['zipcode'];}?>" size="30"></td>
                                  </tr>
								  <tr>
                                    <td height="27" valign="bottom" class="simpletxt">&nbsp;Daytime Phone </td>
                                    <td height="27" colspan="2" valign="bottom" class="simpletxt"><INPUT name="PHN_DayPhone" type="TEXT" value="<? if($getData['dayphone']!=0){echo $getData['dayphone'];}?>" size="30">
                                    </td>
                                  </tr>
                                  <tr>
                                    <td height="27" valign="bottom" class="simpletxt">&nbsp;Evening Phone </td>
                                    <td height="27" colspan="2" valign="bottom" class="simpletxt"><INPUT name="PHN_EveningPhone" type="TEXT" value="<? if($getData['eveningphone']!=0){echo $getData['eveningphone'];}?>" size="30">
                                    </td>
                                  </tr>
								  <tr>
                                    <td height="27" valign="bottom" class="simpletxt">&nbsp;Cell Phone </td>
                                    <td height="27" colspan="2" valign="bottom" class="simpletxt"><INPUT name="PHN_CellPhone" type="TEXT" value="<? if($getData['cellphone']!=0){echo $getData['cellphone'];}?>" size="30">
                                    </td>
                                  </tr>
								   <tr>
                                    <td height="27" valign="bottom" class="simpletxt">&nbsp;E-mail </td>
                                    <td height="27" colspan="2" valign="bottom" class="simpletxt"><INPUT name="TNEF_Email" type="TEXT" value="<?=$getData['email'];?>" size="30">
                                    </td>
                                  </tr>
								  <tr>
									<td class="simpletxt"  >&nbsp;Login </td>
									<td class="simpletxt">
										<INPUT name="TNLEN_UserName" type="TEXT" value="<?=$getData['username'];?>">         
									</td>
							      </tr>
								   <tr>
									<td class="simpletxt"  >&nbsp;Password </td>
									<td class="simpletxt">
										<input type="password" name="TN_Password" value="<?=$getData['password'];?>">            
									</td>
								   </tr>
								  
                                  <tr>
                                    <td height="27" valign="bottom" class="simpletxt">&nbsp;Heard Via ? </td>
                                    <td height="27" colspan="2" valign="bottom" class="simpletxt"><select name="TN_LeadType">
                          <option value="">--Select One--</option>
                          <?
				        
						$res_heard=mysql_query("select * from $lead_type_table where business_id='$business_id' order by sortorder");   
						while($row_heard=mysql_fetch_array($res_heard))
						{
							$description=$row_heard["description"];
							echo "<option value=$description";
							if($getData['leadtype']==$description)
							{		
								echo " selected";
							}
							echo ">".$description."</option>";
						}
					?>
                        </select>
                                    </td>
                                  </tr>
                                  <tr>
                                    <td height="27" valign="bottom" class="simpletxt" nowrap="nowrap">&nbsp;Contact Okay </td>
                                    <td height="27" colspan="2" valign="bottom" nowrap class="simpletxt"><label>
                                      <input name="TN_ContactOkay" type="radio" value="1"
								<? 
								if($getData['contactokay']==1){ echo "checked";}?> >
                                      Yes
                                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                      <input name="TN_ContactOkay" type="radio" value="0" 
								<? if($getData['contactokay']==0){ echo "checked";}?> >
                                      No </label>
                                    </td>
                                  </tr>
                                  <tr>
                                    <td height="27" valign="bottom" class="simpletxt" nowrap="nowrap">&nbsp;Call Okay </td>
                                    <td height="27" colspan="2" valign="bottom" nowrap class="simpletxt"><label>
                                      <input name="TN_CallOkay" type="radio" value="1"
								<? 
								
								if($getData['callokay']==1){ echo "checked";}?> >
                                      Yes
                                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                      <input name="TN_CallOkay" type="radio" value="0" 
								<? if($getData['callokay']==0){ echo "checked";}?> >
                                      No
                                       </label>
                                    </td>
                                  </tr>
                                  <tr>
                                    <td height="27" valign="bottom" class="simpletxt" nowrap="nowrap">&nbsp;E-mail Okay </td>
                                    <td height="27" colspan="2" valign="bottom" nowrap class="simpletxt"><label>
                                      <input name="TN_EmailOkay" type="radio" value="1"
								<? 
								if($getData['emailokay']==1){ echo "checked";}?> >
                                      Yes
                                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                      <input name="TN_EmailOkay" type="radio" value="0" 
								<? if($getData['emailokay']==0){ echo "checked";}?> >
                                      No
                                       </label>
                                    </td>
                                  </tr>
								  <tr>
                                    <td height="27" valign="bottom" class="simpletxt" nowrap="nowrap">&nbsp;Mail Okay </td>
                                    <td height="27" colspan="2" valign="bottom" nowrap class="simpletxt"><label>
                                      <input name="TN_MailOkay" type="radio" value="1"
								<? 
								if($getData['mailokay']==1){ echo "checked";}?> >
                                      Yes
                                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                      <input name="TN_MailOkay" type="radio" value="0" 
								<? if($getData['mailokay']==0){ echo "checked";}?> >
                                      No
                                       </label>
                                    </td>
                                  </tr>
                                  
                                 <tr>
                                    <td height="27" valign="bottom" class="simpletxt">&nbsp;Payment Method </td>
                                    <td height="27" colspan="2" valign="bottom" class="simpletxt"><select name="TN_PaymentMethod">
                          <option value="">--Select One--</option>
                          <?
				        
						$res_paytype=mysql_query("select * from $pay_type_table where business_id='$business_id' order by sortorder");   
						while($row_paytype=mysql_fetch_array($res_paytype))
						{
							$description=$row_paytype["description"];
							echo "<option value=$description";
							if($getData['paymentmethod']==$description)
							{		
								echo " selected";
							}
							echo ">".$description."</option>";
						}
					?>
                        </select>
                                    </td>
                                  </tr>
                                  <tr>
                                    <td height="27" valign="bottom" class="simpletxt">&nbsp;Credit Card Number </td>
                                    <td height="27" colspan="2" valign="bottom" class="simpletxt"><INPUT name="TN_CCN"  type="TEXT"  value="<? if($getData['ccn']!=0){echo $getData['ccn'];}?>" size="30"></td>
                                  </tr>
								  <tr>
                                    <td height="27" valign="bottom" class="simpletxt">&nbsp;Exp. Month </td>
                                    <td height="27" colspan="2" valign="bottom" class="simpletxt"><select name="TN_ExpMonth">
									  <option value="">--Select Month--</option>
										<option value='01' <? if($getData['expiredmonth']=='01'){echo "selected";}?>>01</option>
										<option value='02' <? if($getData['expiredmonth']=='02'){echo "selected";}?>>02</option>
										<option value='03' <? if($getData['expiredmonth']=='03'){echo "selected";}?>>03</option>
										<option value='04' <? if($getData['expiredmonth']=='04'){echo "selected";}?>>04</option>
										<option value='05' <? if($getData['expiredmonth']=='05'){echo "selected";}?>>05</option>
										<option value='06' <? if($getData['expiredmonth']=='06'){echo "selected";}?>>06</option>
										<option value='07' <? if($getData['expiredmonth']=='07'){echo "selected";}?>>07</option>
										<option value='08' <? if($getData['expiredmonth']=='08'){echo "selected";}?>>08</option>
										<option value='09' <? if($getData['expiredmonth']=='09'){echo "selected";}?>>09</option>
										<option value='10' <? if($getData['expiredmonth']=='10'){echo "selected";}?>>10</option>
										<option value='11' <? if($getData['expiredmonth']=='11'){echo "selected";}?>>11</option>
										<option value='12' <? if($getData['expiredmonth']=='12'){echo "selected";}?>>12</option>
									</select>
                                    </td>
                                  </tr> 
								  <tr>
                                    <td height="27" valign="bottom" class="simpletxt">&nbsp;Exp. Year </td>
                                    <td height="27" colspan="2" valign="bottom" class="simpletxt"><select name="TN_ExpYear">
									  <option value="">--Select Year--</option>
										<option value='2004' <? if($getData['expiredyear']=='2004'){echo "selected";}?>>2004</option>
										<option value='2005' <? if($getData['expiredyear']=='2005'){echo "selected";}?>>2005</option>
										<option value='2006' <? if($getData['expiredyear']=='2006'){echo "selected";}?>>2006</option>
										<option value='2007' <? if($getData['expiredyear']=='2007'){echo "selected";}?>>2007</option>
										<option value='2008' <? if($getData['expiredyear']=='2008'){echo "selected";}?>>2008</option>
										<option value='2009' <? if($getData['expiredyear']=='2009'){echo "selected";}?>>2009</option>
										<option value='2010' <? if($getData['expiredyear']=='2010'){echo "selected";}?>>2010</option>
										<option value='2011' <? if($getData['expiredyear']=='2011'){echo "selected";}?>>2011</option>
										<option value='2012' <? if($getData['expiredyear']=='2012'){echo "selected";}?>>2012</option>
										<option value='2013' <? if($getData['expiredyear']=='2013'){echo "selected";}?>>2013</option>
										<option value='2014' <? if($getData['expiredyear']=='2014'){echo "selected";}?>>2014</option>
										<option value='2015' <? if($getData['expiredyear']=='2015'){echo "selected";}?>>2015</option>
										<option value='2016' <? if($getData['expiredyear']=='2016'){echo "selected";}?>>2016</option>
									</select>
                                    </td>
                                  </tr> 
								  <tr>
									<td class="simpletxt"  >&nbsp;&nbsp;Card Code </td>
									<td class="simpletxt">
										<INPUT name="TN_CardCode" type="TEXT" value="<? if($getData['cardcode']!=0){echo $getData['cardcode'];}?>">        
									</td>
							      </tr>
								   <tr>
									<td class="simpletxt"  >&nbsp;&nbsp;Name On Card </td>
									<td class="simpletxt">
										<INPUT name="TN_CardName" type="TEXT" value="<? if($getData['cardname']!=0){echo $getData['cardname'];}?>">        
									</td>
								   </tr>
								  <tr>
									<td class="simpletxt"  >&nbsp;&nbsp;Company </td>
									<td class="simpletxt">
										<INPUT name="TN_Company" type="TEXT" value="<? if($getData['companyname']!=0){echo $getData['companyname'];}?>">        
									</td>
							      </tr>
								   <tr>
									<td class="simpletxt"  >&nbsp;&nbsp;Occupation </td>
									<td class="simpletxt">
										<INPUT name="TN_Occupation" type="TEXT" value="<? if($getData['occupation']!=0){echo $getData['occupation'];}?>">        
									</td>
								   </tr>
								   <tr>
									<td class="simpletxt"  >&nbsp;&nbsp;Birth Date </td>
									<td class="simpletxt">
										<script>DateInput('BirthDate', true, 'YYYY-MM-DD','<?=$birthdate;?>')</script>
									</td>
								   </tr>
                                  
                                  <tr>
                                    <td height="27" valign="bottom" class="simpletxt">&nbsp;Gender </td>
                                    <td height="27" colspan="2" valign="bottom" nowrap class="simpletxt"><label>
                                      <select name="TN_Gender">
                      <option value=''>--Select Gender--</option>
                      <option value='Male' 
				   <? if($getData['gender']=="Male")
			          {
					     echo "selected";
					  }
					?>>Male</option>
							  <option value='Female' <? if($getData['gender']=="Female")
							  {
								 echo "selected";
							  }
					?>>Female</option>
                    </select>
                                    </label></td>
                                  </tr>
								  <tr>
                                    <td height="27" valign="bottom" class="simpletxt">&nbsp;Status </td>
                                    <td height="27" colspan="2" valign="bottom" class="simpletxt"><select name="TN_CustomerStatus">
                          <option value="">--Select Status--</option>
                          <?
				        
						$res_heard=mysql_query("select * from $customer_status_type_table where business_id='$business_id' order by sortorder");   
						while($row_heard=mysql_fetch_array($res_heard))
						{
							$description=$row_heard["description"];
							echo "<option value=$description";
							if($getData['status']==$description)
							{		
								echo " selected";
							}
							echo ">".$description."</option>";
						}
					?>
                        </select>
                                    </td>
                                  </tr>
								  <tr>
                                    <td height="27" valign="bottom" class="simpletxt" nowrap="nowrap">&nbsp;Allowed To Log-In </td>
                                    <td height="27" colspan="2" valign="bottom" nowrap class="simpletxt"><label>
                                      <input name="TN_LoginAllowed" type="radio" value="1"
								<? 
								
								if($getData['loginallowed']==1){ echo "checked";}?> >
                                      Yes
                                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                      <input name="TN_LoginAllowed" type="radio" value="0" 
								<? if($getData['loginallowed']==0){ echo "checked";}?> >
                                      No
                                       </label>
                                    </td>
                                  </tr>
								  <tr>
                                    <td height="27" valign="bottom" class="simpletxt">&nbsp;Type </td>
                                    <td height="27" colspan="2" valign="bottom" class="simpletxt"><select name="TN_CustomerType">
                          <option value="">--Select Customer Type--</option>
                          <?
				        
						$res_heard=mysql_query("select * from $customer_type_table where business_id='$business_id' order by sortorder");   
						while($row_heard=mysql_fetch_array($res_heard))
						{
							$description=$row_heard["description"];
							echo "<option value=$description";
							if($getData['customertype']==$description)
							{		
								echo " selected";
							}
							echo ">".$description."</option>";
						}
					?>
                        </select>
                                    </td>
                                  </tr>
								  <tr>
                                    <td height="27" valign="bottom" class="simpletxt">&nbsp;Assigned To </td>
                                    <td height="27" colspan="2" valign="bottom" class="simpletxt"><select name="TN_AssignedTo">
                          <option value="">--Select Staff--</option>
                          <?
				        
						$res_staff=mysql_query("select * from $staff_table where business_id='$business_id' order by last_name desc");   
						while($row_staff=mysql_fetch_array($res_staff))
						{
						    $staff_id = $row_staff["staff_id"];
							$first_name = $row_staff["first_name"];
							$last_name = $row_staff["last_name"];
							$full_name = $last_name.","." ".$first_name;
							echo "<option value='$staff_id'";
							if($getData['staffassignedto']==$staff_id)
							{		
								echo " selected";
							}
							echo ">".$full_name."</option>";
						}
					?>
                        </select>
                                    </td>
                                  </tr>
								  <tr>
									<td class="simpletxt"  >&nbsp;&nbsp;Account Number </td>
									<td class="simpletxt">
										<INPUT name="TN_AccountNumber" type="TEXT" value="<? if($getData['accountnumber']!=0){echo $getData['accountnumber'];}?>">        
									</td>
							      </tr>
								   <tr>
									<td class="simpletxt"  >&nbsp;&nbsp;Special Needs </td>
									<td class="simpletxt">
										<INPUT name="TN_SpecialNeeds" type="TEXT" value="<?=$getData['specialneeds'];?>">        
									</td>
								   </tr>
								   <tr>
									<td class="simpletxt"  >&nbsp;&nbsp;Alert </td>
									<td class="simpletxt">
										<INPUT name="TN_Alert" type="TEXT" value="<?=$getData['alert'];?>">        
									</td>
								   </tr>
								   <tr>
									<td class="simpletxt"  >&nbsp;&nbsp;Referred By </td>
									<td class="simpletxt">
										<INPUT name="TN_ReferredBy" type="TEXT" value="<?=$getData['referredby'];?>">        
									</td>
								   </tr>
                                  <tr>
                                    <td colspan="3" align="center" valign="middle" class="smallText"><input name="Submit" type="submit" class="button" value="  Update  " />
                                      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
                                      <input name="reset" type="reset" class="button" value="  Reset  " />
									  <input type="hidden" name="customer_id" value="<?=$customer_id;?>">
                                    </td>
                                  </tr>
                                </table>
                              </form></td>
                                  </tr>
                                </table>
                              <table border="0" cellspacing="0" cellpadding="0" align="center" class="box_width_cont product">
                                  <tr>
                                    <td></td>
                                  </tr>
                              </table></td>
                          </tr>
                        </table>
						
						<table cellpadding="0" cellspacing="0" border="0">
							<tr>
								<td><img src="images/1_q4.gif" border="0" alt="" width="10" height="10"></td>
								<td style="width:100%; background-image:url(images/1_li1.gif)"></td>
								<td><img src="images/1_q3.gif" border="0" alt="" width="10" height="10"></td>
							</tr>
						</table>
						


		
		
		</td>

    <td class="col_right">

<table border="0"cellspacing="0" cellpadding="0" class="box_width_right">
	<tr><td></td>
		<td width="100%">
			<table border="0" cellspacing="0" cellpadding="0">
				<tr><td></td></tr>
			</table>
		</td>
	</tr>
</table>


    </td>
  </tr>
</table>



		</td>
	</tr>
	<tr>
		<td>
			<table cellpadding="0" cellspacing="0" border="0" style="height:98px; background-image:url(images/bot.gif)">
				<tr>
					<td>
						<table cellpadding="0" cellspacing="0" border="0" class="footer">
							<tr>									
								<td height="77"><img src="images/spacer.gif" border="0" alt="" width="25" height="1"></td>				
								<td style="width:207px"><br style="line-height:49px"><img src="images/p1.gif" border="0" alt="" width="145" height="24"><br></td>
							  <td style="width:532px">&nbsp;</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table></td></tr></table>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td align="center"></td>
  </tr>
</table>
</body>

</html>